#!/bin/bash
# A script to copy my kernel onto a GRUB loaded floppy disk
# Must be run as root

ROOT_UID=0	#UID is 0 for users with root priveledges
lines=50


if [ "$UID" -ne "$ROOT_UID" ]	#Check if the user is root, exit if not
then 
	echo "Must be root to run this script."
	exit
fi				#end if

echo "Creating vflop directory"
mkdir /mnt/vflop

losetup -d /dev/loop0 				#Get rid of any existing loopback device
losetup /dev/loop0 GRUB.img			#Mount the grub image on loopback
mount -t vfat /dev/loop0 /mnt/vflop		#Mount loop0 under /mnt/vflop
cp /binary/kernel.bin /mnt/vflop/kernel.bin	#Copy the new kernel
umount /mnt/vflop				#Unmount vflop
losetup -d /dev/loop0				#unmount the loop0




